package gui;

import java.util.Locale;
import java.util.ResourceBundle;

public class Taal {
//Attributen
	private String language;
	private String country;
	private ResourceBundle berichten;
//Constructor
	public Taal(int keuze){
		setBundle(keuze);
	}
//methodes
 //Getters & Setters
	public ResourceBundle getBundle(){
		//bundle met juiste berichten terug geven
		return berichten;
	}
	
	public void setBundle(int keuze)
	{
		this.berichten = keuzeVerwerking(keuze);
		System.out.println(keuze);
	}
 //Keuze
	public ResourceBundle keuzeVerwerking(int keuze)
	{
		switch(keuze)
		{
			case 1:language = new String("en");
				   country = new String("US");
				   break;
			case 2:language = new String("fr");
				   country = new String("FR");
				   break;
			default:language = new String("ne");
					country = new String("NL");
					break;
		}

		Locale currentLocale;
		currentLocale = new Locale(language, country);

		ResourceBundle taal = ResourceBundle.getBundle("MessagesBundle",currentLocale);
		
		return taal;
	}
}